package com.project.sianet.data;

import java.util.ArrayList;
import java.util.List;

import com.project.sianet.entidades.Menu;

import android.content.Context;
import android.widget.ArrayAdapter;

public class ColegioArrayAdapter extends ArrayAdapter<Menu> {
	
    private List<Menu> menues = new ArrayList<Menu>();
 
    public ColegioArrayAdapter(Context context, int textViewResourceId,
            List<Menu> objects) {
        super(context, textViewResourceId, objects);
        this.menues = objects;
    }
 
    public int getCount() {
        return this.menues.size();
    }
 
    public Menu getItem(int index) {
        return this.menues.get(index);
    }
    
    public String getValue(int index) {
    	return getItem(index).src;
    }
    
    public int getPosition (String value) {
    	int position = 0;
    	for (int i = 0; i < getCount(); i++) {
    		if (getItem(i).src.equals(value)) {
    			position = i;
    			break;
    		}
    			
    	}
    	return position;
    }
	
}
